<template>
	<view class="page">
		<u-navbar title="我的草稿" autoBack fixed placeholder leftIconColor="#232832" titleStyle="color: #232832"
			bgColor="#FFFFFF"></u-navbar>
		<c-content :top="statusBarHeight + 44">
			<view class="tab1">
				<view class="card" v-for="i in 10" :key="i">
					<view class="card-body">
						<view class="card-body__article">
							<u-parse>
								dasdasddddddddddd
								asdaaaaaaaaaa
								asdasssssssssssssssss
								2131231
							</u-parse>
						</view>
						<view class="card-body__album" @click.self.stop>
							<u-album :urls="list" :maxCount="9" borderRadius="8px" :multipleSize="boxWidth"></u-album>
						</view>
						<view class="card-body__video">

						</view>
					</view>
					<view class="card-footer">
						<view class="btn edit" @click="edit(item)">
							<u-icon name="edit-pen" :size="20" color="#6E86FF"></u-icon>
							<text>编辑</text>
						</view>
						<view class="btn del" @click="remove(item)">
							<u-icon name="trash" :size="20" color="#FF4E4D"></u-icon>
							<text>删除</text>
						</view>
					</view>
				</view>
			</view>
		</c-content>
	</view>
</template>

<script>
	import mixins from '@/mixins/index.js'
	export default {
		mixins: [mixins],
		data() {
			return {
				list: [
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				]
			}
		},
		computed: {
			boxWidth() {
				const rs = uni.getSystemInfoSync()
				console.log(rs.windowWidth - 28);
				const width = (rs.windowWidth - 12 - 44) / 3
				return width
			}
		},
		methods: {
			edit(item) {
				uni.navigateTo({
					url: `/pages/common/publish?type=${item.type}&item=${JSON.stringify(item)}`
				})
			},
			remove(item) {

			}
		}
	}
</script>

<style scoped lang="scss">
	.card {
		margin: 20px 12px;
		background-color: #FFFFFF;
		border-radius: 15px;
		padding: 10px;
		box-sizing: border-box;

		.card-header {
			display: flex;
			align-items: center;

			&__title {
				flex: 1;
				margin-left: 10px;
			}

			.header-title {
				color: #232832;
				font-size: 15px;
				font-weight: 700;
				line-height: 18px;
			}

			.header-label {
				margin-top: 3px;
				color: #B9BCC3;
				font-size: 12px;
				line-height: 16px;
				font-weight: 400;
			}

			&__value {
				display: flex;
				align-items: center;
				justify-content: flex-end;

				.btn {
					display: flex;
					align-items: center;
					justify-content: center;
					padding: 4px 14px;
					border-radius: 15px;
					border: 1px solid #6E86FF;
					color: #6E86FF;
					font-size: 15px;
					font-weight: 400;
				}
			}
		}

		.card-body {
			display: flex;
			align-items: center;
			flex-direction: column;
			width: 100%;
			margin-top: 0px;
			padding-top: 10px;

			&__article {
				margin: 5px 0 15px;
				color: #232832;
				text-indent: 2em;
			}

			&::v-deep .u-album__row__wrapper {
				border-radius: 4px;
				overflow: hidden;
			}
		}

		.card-footer {
			display: flex;
			align-items: center;
			justify-content: center;
			padding: 10px 0 0;

			.btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				padding-top: 10px;

				&.edit {
					color: #6E86FF;
				}

				&.del {
					color: #FF4E4D;
				}
			}
		}
	}
</style>